/* 
 * File:   main.cpp
 * Author: Yujie Hao
 *
 * Created on March 17, 2013, 10:11 PM
 */

#include <cstdlib>
#include <iostream>
using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    int date = 0;
    
    cout << "Is your birthday in set 1?" << endl;
    cout << " 1   3   5   7" << endl << " 9  11  13  15" << endl << "17  19  21  23" << endl << "25  27  29  31" << endl;
    char inSet;
    cout << "If it is in this set, please enter y, else enter n:";
    cin >> inSet;
    if (inSet == 'y')
    {
        date += 1;
    }
    else if(inSet == 'n');
    else 
    {
        cout << "Please type either y or n." << endl;
    }
    
    cout << "Is your birthday in set 2?" << endl;
    cout << " 2   3   6   7"<< endl << "10  11  14  15" << endl << "18  19  22  23" << endl << "26  27  30  31" << endl;
    cout << "If it is in this set, please enter y, else enter n:";
    cin >> inSet;
    if (inSet == 'y')
    {
        date += 2;
    }
    else if(inSet == 'n');
    else 
    {
        cout << "Please type either y or n." << endl;
    }
    
    cout << "Is your birthday in set 3?" << endl;
    cout << " 4   5   6   7"<< endl << "12  13  14  15" << endl << "20  21  22  23" << endl << "28  29  30  31" << endl;
    cout << "If it is in this set, please enter y, else enter n:";
    cin >> inSet;
    if (inSet == 'y')
    {
        date += 4;
    }
    else if(inSet == 'n');
    else 
    {
        cout << "Please type either y or n." << endl;
    }
    
    cout << "Is your birthday in set 4?" << endl;
    cout << " 8   9  10  11"<< endl << "12  13  14  15" << endl << "24  25  26  27" << endl << "28  29  30  31" << endl;
    cout << "If it is in this set, please enter y, else enter n:";
    cin >> inSet;
    if (inSet == 'y')
    {
        date += 8;
    }
    else if(inSet == 'n');
    else 
    {
        cout << "Please type either y or n." << endl;
    }
    
    cout << "Is your birthday in set 5?" << endl;
    cout << "16  17  18  19"<< endl << "20  21  22  23" << endl << "24  25  26  27" << endl << "28  29  30  31" << endl;
    cout << "If it is in this set, please enter y, else enter n:";
    cin >> inSet;
    if (inSet == 'y')
    {
        date += 16;
    }
    else if(inSet == 'n');
    else 
    {
        cout << "Please type either y or n." << endl;
    }
    
    cout << "Your birthday is " << date << endl;
    
    return 0;
}

